import 'cube.css/src/scss/neat.scss'
import 'static/font/iconfont.css'
import '@/base/scss/common.scss'
import './help.scss'
import Vue from 'vue'
import VueRouter from 'vue-router'
import mixins from '@/mixins'
import UnifyHeader from 'components/header/header'

import ServiceTerms from './center/serviceTerms' //网站中心
import SiteMap from './center/siteMap' //网站中心
import PayMent from './center/payment' //支付方式
import Personalpage from './center/personalpage' //个人主页
import Artalbum from './center/artalbum' //艺术画册
import Artmagnet from './center/artmagnet' //艺术磁贴画
import Artdrawing from './center/artdrawing' //艺术框画
import Artcollection from './center/artcollection' //艺术合集
import Artposters from './center/artposters' //艺术海报
import Picturealbum from './center/picturealbum' //方画册
import Lightset from './center/lightset' //拾光集
import Hourslight from './center/hourslight' //小时光
import Letter from './center/letter' //家书
import Calendar from './center/calendar' //挂历
import Deskcalendar from './center/deskcalendar' //台历
import DeliveryProcess from './center/deliveryProcess' //配送流程
import ReTurn from './center/return' //退换货
import CooperaTion from './center/cooperation' //商务合作
import Artron from './center/artron' //传给雅昌
import ConTact from './center/contact' //联系我们
import PlatForm from './center/platform' //其他平台

Vue.use(VueRouter)
Vue.mixin(mixins)

const NAV_DATA = [{
  title: '关于我们',
  children: [{
    title: '传给雅昌',
    url: '/artron'
  }, {
    title: '商务合作',
    url: '/cooperation'
  }, {
    title: '联系我们',
    url: '/contact'
  }, {
    title: '其他平台',
    url: '/platform'
  }]
}, {
  title: '帮助中心',
  children: [{
    title: '个人主页',
    url: '/personalpage'
  }, {
    title: '艺术画册',
    url: '/artalbum'
  }, {
    title: '艺术磁贴画',
    url: '/artmagnet'
  }, {
    title: '艺术框画',
    url: '/artdrawing'
  }, {
    title: '艺术合集',
    url: '/artcollection'
  }, {
    title: '艺术海报',
    url: '/artposters'
  }, {
    title: '方画册',
    url: '/picturealbum'
  }, {
    title: '拾光集',
    url: '/lightset'
  }, {
    title: '小时光',
    url: '/hourslight'
  }, {
    title: '家书',
    url: '/letter'
  }, {
    title: '挂历',
    url: '/calendar'
  }, {
    title: '台历',
    url: '/deskcalendar'
  }, {
    title: '支付方式',
    url: '/payment'
  }, {
    title: '配送流程',
    url: '/deliveryProcess'
  }, {
    title: '退换货',
    url: '/return'
  }]
}, {
  children: [{
    title: '服务条款',
    url: '/serviceTerms'
  }]
}, {
  children: [{
    title: '网站地图',
    url: '/siteMap'
  }]
}]
let router = new VueRouter({
  routes: [{
    path: '/',
    redirect: '/artron'
  }, { //传给雅昌
    path: '/artron',
    name: 'artron',
    component: Artron,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { //商务合作
    path: '/cooperation',
    name: 'cooperaTion',
    component: CooperaTion,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { //联系我们
    path: '/contact',
    name: 'conTact',
    component: ConTact,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { //其他平台
    path: '/platform',
    name: 'platForm',
    component: PlatForm,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 网站中心
    path: '/serviceTerms',
    name: 'serviceTerms',
    component: ServiceTerms,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 网站地图
    path: '/siteMap',
    name: 'siteMap',
    component: SiteMap,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 个人主页
    path: '/personalpage',
    name: 'Personalpage',
    component: Personalpage,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 艺术画册
    path: '/artalbum',
    name: 'Artalbum',
    component: Artalbum,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 艺术磁贴画
    path: '/artmagnet',
    name: 'Artmagnet',
    component: Artmagnet,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 艺术框画
    path: '/artdrawing',
    name: 'Artdrawing',
    component: Artdrawing,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 艺术合集
    path: '/artcollection',
    name: 'Artcollection',
    component: Artcollection,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 艺术海报
    path: '/artposters',
    name: 'Artposters',
    component: Artposters,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 方画册
    path: '/picturealbum',
    name: 'Picturealbum',
    component: Picturealbum,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 拾光集
    path: '/lightset',
    name: 'Lightset',
    component: Lightset,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 小时光
    path: '/hourslight',
    name: 'Hourslight',
    component: Hourslight,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 家书
    path: '/letter',
    name: 'Letter',
    component: Letter,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 挂历
    path: '/calendar',
    name: 'Calendar',
    component: Calendar,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 台历
    path: '/deskcalendar',
    name: 'Deskcalendar',
    component: Deskcalendar,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 支付方式
    path: '/payment',
    name: 'payMent',
    component: PayMent,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 配送流程
    path: '/deliveryProcess',
    name: 'deliveryProcess',
    component: DeliveryProcess,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }, { // 退换货
    path: '/return',
    name: 'reTurn',
    component: ReTurn,
    meta: {
      title: '雅昌影像-艺术小时光制作照片书定制,摄影作品出版-传给雅昌专业定制'
    }
  }]
})

router.afterEach((to, from, next) => {
  if (to.meta.title) {
    window.document.title = to.meta.title
  }
})

//eslint-disable-next-line no-new
new Vue({
  el: '#app',
  data: {
    navList: NAV_DATA,
    currentLi: null
  },
  watch: {
    '$route'(to, from) {
      this.currentLi = to.path
    }
  },
  methods: {},
  mounted() {
  },
  created: function () {
    this.currentLi = this.$route.path
    document.body.style.cssText = 'opacity:1;'
  },
  components: {
    UnifyHeader
  },
  router
})
